﻿#include <iostream>
using namespace std;

#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
            TypeName(const TypeName&);\
            void operator=(const TypeName&)

#define CC_DISABLE_COPY(Class) \
private: \
    Class(const Class &); \
    Class &operator =(const Class &);

template <typename T>
class FinalBase{
    friend T;
private:
    FinalBase(){
        cout << "FinalBase" << endl;
    }
    ~FinalBase(){}
};

class FinalClass : virtual public FinalBase<FinalClass>{   //MUST be virtual inherit
public:
    FinalClass(){
        cout << "FinalClass" << endl;
    }
};

class DisableCopyClass{
private:
	int val;

public:
	DisableCopyClass(int a):val(a){};

	CC_DISABLE_COPY(DisableCopyClass)
};

